from django.db import models

class Author(models.Model):
    SEX=[('F','女'),('M','男')]
    name=models.CharField(max_length=10)
    sex=models.CharField(max_length=1,choices=SEX)
    sfz=models.CharField(max_length=18,null=False,unique=True)

class Article(models.Model):
    TYPE=[('0','原创'),('1','转载'),('2','翻译')]
    name=models.CharField(max_length=10)
    content=models.TextField()
    create=models.DateTimeField(auto_now_add=True)
    update=models.DateTimeField(auto_now=True)
    banben=models.CharField(max_length=1,choices=TYPE)
    author=models.ForeignKey(Author,on_delete=models.CASCADE)
